package com.yalemang.androidclassroom.day04

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.yalemang.androidclassroom.R
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode

class BActivity:AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_b)
        EventBus.getDefault().register(this)
    }

    @Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
    fun test(testEvent: TestEvent){
        Log.d("Ellen2023","B收到粘性事件")
    }

    @Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
    fun test2(string: String){
        Log.d("Ellen2023","B收到粘性事件")
    }


}